package com.lanyou.esb.web.param;

import org.apache.commons.lang3.StringUtils;

/**
 * 系统日期级别管理查询条件
 * 
 * @author Davey.wu
 */
public class SystemLogLevelManagementParam implements Comparable {
	/**服务**/
	private String service;
	/**BUNDLE名称**/
	private String bundleName;
	/**日志级别**/
	private String level;
	/**开始时间**/
	private String startReceivedTime;
	/**结束时间 **/
	private String endReceivedTime;
	/**ServiceMix服务地址**/
	private String serviceMixIp;

	public String getService() {
		return service;
	}

	public void setService(String service) {
		this.service = service;
	}

	public String getBundleName() {
		return bundleName;
	}

	public void setBundleName(String bundleName) {
		this.bundleName = bundleName;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public String getStartReceivedTime() {
		return startReceivedTime;
	}

	public void setStartReceivedTime(String startReceivedTime) {
		this.startReceivedTime = startReceivedTime;
	}

	public String getEndReceivedTime() {
		return endReceivedTime;
	}

	public void setEndReceivedTime(String endReceivedTime) {
		this.endReceivedTime = endReceivedTime;
	}

	@Override
	public int compareTo(Object o) {
		if (o == null) {
			return -1;
		}
		if (!(o instanceof SystemLogLevelManagementParam)) {
			return -1;
		}
		SystemLogLevelManagementParam other = (SystemLogLevelManagementParam) o;
		if (StringUtils.equals(this.service, other.service)
				&& StringUtils.equals(this.bundleName, other.bundleName)
				&& StringUtils.equals(this.level, other.level)
				&& StringUtils.equals(this.startReceivedTime,
						other.startReceivedTime)
				&& StringUtils.equals(this.endReceivedTime,
						other.endReceivedTime)) {
			return 0;
		}
		return -1;
	}

	@Override
	public boolean equals(Object o) {
		if (o == null) {
			return false;
		}
		if (!(o instanceof SystemLogLevelManagementParam)) {
			return false;
		}
		SystemLogLevelManagementParam other = (SystemLogLevelManagementParam) o;
		if (StringUtils.equals(this.service, other.service)
				&& StringUtils.equals(this.bundleName, other.bundleName)
				&& StringUtils.equals(this.level, other.level)
				&& StringUtils.equals(this.startReceivedTime,
						other.startReceivedTime)
				&& StringUtils.equals(this.endReceivedTime,
						other.endReceivedTime)) {
			return true;
		}
		return false;
	}

	@Override
	public int hashCode() {
		int codeService = StringUtils.isBlank(service) ? 0 : service.hashCode();
		int codeBundleName = StringUtils.isBlank(bundleName) ? 0 : bundleName
				.hashCode();
		int codeLevel = StringUtils.isBlank(level) ? 0 : level.hashCode();
		int codeStartReceivedTime = StringUtils.isBlank(startReceivedTime) ? 0
				: startReceivedTime.hashCode();
		int codeEndReceivedTime = StringUtils.isBlank(endReceivedTime) ? 0
				: endReceivedTime.hashCode();
		return codeService + codeBundleName + codeLevel + codeStartReceivedTime
				+ codeEndReceivedTime;
	}

	public String getServiceMixIp() {
		return serviceMixIp;
	}

	public void setServiceMixIp(String serviceMixIp) {
		this.serviceMixIp = serviceMixIp;
	}
}
